﻿@{
    Layout = null;
}
@model TjZheng.Test.DataEntity.Test1
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <style type="text/css">
        div {
            width: 100%;
        }
    </style>
    <script src="~/Content/js/jquery-1.8.2.js"></script>
    <script src="~/Content/js/tjzheng.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/Content/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
    <div>
        <h1>完整demo</h1>
        <form id="form">
            <table>
                <tr>
                    <td colspan="2">
                        <input type="button" id="btn_submit" value="提交" />
                    </td>
                </tr>
                <tr>
                    <td>Name：</td>
                    <td>
                        <input type="text" value="@Model.Name" name="objTest1.Name" /></td>
                </tr>
                <tr>
                    <td>Content：</td>
                    <td>
                        <script id="editor" type="text/plain" name="objTest1.Content" type="text/plain" style="width: 1024px; height: 500px;">
                        </script>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <script type="text/javascript">
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        var ue = UE.getEditor('editor');
        ue.ready(function () {
            //ue.execCommand('serverparam', {
            //    'ULId': '3',
            //    'CategoryCode': 'Ueditor',
            //    'LimitCode': 'Images',
            //});
            ue.setContent("@Html.Raw(Model.Content)");
        });
        $("#btn_submit").click(function () {
            var objFormEntity = new FormEntity("#form");
            objFormEntity.submitSuccess = function (objInvokeResult) {
                alert(objInvokeResult.ResultMessage);
            };
            objFormEntity.isClearData = false;
            objFormEntity.url = "/ue/save";
            objFormEntity.submit();
        });
    </script>
</body>
</html>
